import socket
import threading
import time
import struct
import redis
import queue

class TPgk (object):
    def __init__(self):
        self.bodyBytes=None
        self.recNo = 0
        self.sendNo = 0
        self.isPing = 0
        self.isIFrame = 0
    def decode(self) -> None:
        try:
            pass
        except Exception as e:
            print(e)

class TSlaver(object):
    def __init__(self) -> None:
        try:
            #config
            self.code = ""
            self.host = "10.168.1.100"
            self.port = 2404
            #status
            self.recNo =0
            self.sendNo = 0
            self.isActive = 0
            #threads
            self.thRec = None
            self.thSend = None
            self.thPing
            #object
            self.sk = None
            #events
            self.onConnect = None
            self.onDisConnect = None
            self.onRecIFrame = None
        except Exception as e:
            print(e)
    def connect(self) -> None:
        try:
            pass
        except Exception as e:
            print(e)
    def recPgks(self) -> None:
        try:
            pass
        except Exception as e:
            print(e)
    def ping(self) -> None:
        try:
            pass
        except Exception as e:
            print(e)
    def pong(self) -> None:
        try:
            pass
        except Exception as e:
            print(e)
    def responeS(self) -> None:
        try:
            pass
        except Exception as e:
            print(e)
    def activeSlaver(self) -> None:
        try:
            pass
        except Exception as e:
            print(e)
    def callTotal(self) -> None:
        try:
            pass
        except Exception as e:
            print(e)

class TUploader(object):
    def __init__(self):
        try:
            #config
            self.host = ""
            self.port = 0
            self.db = 2
            #object
            self.client = None
        except Exception as e:
            print(e)
class TMaster(object):
    def __init__(self):
        try:
            # message buffer
            self.buf = None
            # slaver clients
            self.slavers =[]
            # uploader
            self.upload = TUploader()
        except Exception as e:
            print(e)
    def start(self) -> None:
        try:
            pass
        except Exception as e:
            print(e)+655